/*
 * @FilePath: /cpp_study/ch05/enum.cpp
 * @Description: 将枚举值用作标签,switch语句将int值和枚举量标签进行比较时,将枚举量提升为int
 * @Author: dengrunting
 * @Date: 2022-01-10 18:16:30
 * @LastEditTime: 2022-01-10 18:21:38
 */
#include<iostream>
enum {red, orange, yellow, green, blue, violet, indigo};

int main(){
    using namespace std;
    cout << "Enter color code (0-6): ";
    int code;
    cin >> code;
    while (code >= red && code << indigo){
        switch (code){
            case red: cout << "Her lips were red.\n"; break;
            case orange: cout << "Her hair were orange.\n"; break;
            case yellow:
                cout << "Her shoes were yellow.\n";
                break;
            case green:
                cout << "Her nails were green.\n";
                break;
            case blue:
                cout << "Her sweatsuit were blue.\n";
                break;
            case violet:
                cout << "Her eyes were violet.\n";
                break;
            case indigo:
                cout << "Her mood was indigo.\n";
                break;
        }
        cout << "Enter color code (0-6): ";
        cin >> code;
    }
    cout << "Bye!\n";
    return 0;
}
